<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<style>
    .btn {
        position: absolute;
        top: 30%;
        left: 30%;
        background: red;
        color: #FFFFFF;
        text-align: center;
        line-height: 50px;
        width: 200px;
        height: 50px;
        border-radius: 10px;
        cursor: pointer;
    }
    .btns {
        position: absolute;
        top: 50%;
        left: 50%;
        background: red;
        color: #FFFFFF;
        text-align: center;
        line-height: 50px;
        width: 200px;
        height: 50px;
        border-radius: 10px;
        cursor: pointer;
    }
</style>
<body>
<div class="btn" onclick="getRandomNumber(30, 60)">点击获取随机数</div>

<div class="btns" onclick="timeout()">延时30S到60S</div>
</body>
</html>
<script>
    function timeout() {
        console.log(111111)
        let time = setTimeout(()=> {
            console.log('执行了')
            // clearTimeout(time)
        }, getRandomNumber(5,10))
    }

    // 获取随机整数
    function getRandomNumber(min, max) {
        const num = (Math.floor(Math.random() * (max - min + 1)) + min) * 100
        console.log(num)
        return num;
    }

</script>
